from django.contrib import admin
from .models import Category, Course

admin.site.site_header = 'CSDN微课后台管理'
admin.site.index_title = '后台系统'
admin.site.site_title = '管理'

# Register your models here.
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    list_display = ['name']
    search_fields = ['name']

@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
    list_display = ['id', 'courseName', 'fileName', 'imgName', 'price', 'status', 'createDatetime']
    list_filter = ['price', 'status', 'createDatetime']
    search_fields = ['courseName', 'summary']
